angular.module('jl-customer', [
    'ionic'
    'ionic.service.core'
    'ngStorage'
    'templates'
    'wf-config'
    'app-api'
    'wf-tab'
    'tab-home'
    'tab-yuyue'
    'tab-orderDetail'
    'tab-myself'
    'tab-myinfo'
    'tab-visinfo'
    'tab-editinfo'
    'tab-pay'
    'modal'
    'tab-order-list'
    'app-router'
    'app-component-directive'
    'app-util-func'
    'app-initial'
    'app-util-interceptor'
    'ionic-datepicker'
])

.service 'tabData', ($rootScope, $ionicViewSwitcher) ->
    tabName = ['tab.home','tab.order-list', 'tab.myself']
    unwatch = $rootScope.$on '$stateChangeStart', (event, toState, toParams, fromState, fromParams)->
        if toState.name in tabName and fromState.name in tabName
            $ionicViewSwitcher.nextTransition 'none'

    [
        {state: 'tab.home', iconOn: 'wf-index-on', iconOff: 'wf-index-off', title: '首页'}
        {state: 'tab.order-list', iconOn: 'wf-order-on', iconOff: 'wf-order-off', title: '订单'}
        {state: 'tab.myself', iconOn: 'wf-my-on', iconOff: 'wf-my-off', title: '我的'}
    ]
